package com.ruoyi.query.domain;

import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.query.enums.TableColumnTypeEnum;

import java.util.Objects;

/**
 * @描述 列信息
 * @作者 DL
 * @创建时间 2023-12-19
 * @修改人
 * @修改时间
 */
public class TableColumn extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /** 编号 */
    private Long columnId;

    /** 归属表编号 */
    private Long tableId;

    /** 列名称 */
    private String columnName;

    /** 列描述 */
    private String columnComment;

    /** 列类型 */
    /**  （input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、image图片上传控件、upload文件上传控件、editor富文本控件） */
    private TableColumnTypeEnum columnType;

    /** 字典类型 */
    private String dictType;

    public Long getColumnId() {
        return columnId;
    }

    public void setColumnId(Long columnId) {
        this.columnId = columnId;
    }

    public Long getTableId() {
        return tableId;
    }

    public void setTableId(Long tableId) {
        this.tableId = tableId;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getColumnComment() {
        return columnComment;
    }

    public void setColumnComment(String columnComment) {
        this.columnComment = columnComment;
    }

    public TableColumnTypeEnum getColumnType() {
        return columnType;
    }

    public void setColumnType(TableColumnTypeEnum columnType) {
        this.columnType = columnType;
    }

    public String getDictType() {
        return dictType;
    }

    public void setDictType(String dictType) {
        this.dictType = dictType;
    }

    @Override
    public String toString() {
        return "TableColumn{" +
                "columnId=" + columnId +
                ", tableId=" + tableId +
                ", columnName='" + columnName + '\'' +
                ", columnComment='" + columnComment + '\'' +
                ", columnType=" + columnType +
                ", dictType='" + dictType + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TableColumn that = (TableColumn) o;
        return Objects.equals(columnId, that.columnId) && Objects.equals(tableId, that.tableId) && Objects.equals(columnName, that.columnName) && Objects.equals(columnComment, that.columnComment) && columnType == that.columnType && Objects.equals(dictType, that.dictType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(columnId, tableId, columnName, columnComment, columnType, dictType);
    }
}
